//
//  HZMCVCell2.m
//  糖糖大魔王
//
//  Created by 韩震明 on 15/10/28.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "HZMCVCell2.h"
#define WIDTH self.backView.frame.size.width
#define HEIGHT self.backView.frame.size.height

@implementation HZMCVCell2

- (void)dealloc
{
    [_numberLabel release];
    [_titleLabel release];
    [_descLabel release];
    [_picImageViewHead release];
    [_picImageViewFoot release];
    [_commentImageView release];
    [_commentLabel release];
    [_islikeImageView release];
    [_islikeLabel release];
    [_buyButton release];
    [_priceImageView release];
    [_priceLabel release];
    [_backView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell
{
    self.backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 4 * self.contentView.frame.size.height / 3)];
    [self.contentView addSubview:self.backView];
    [_backView release];
    
    self.numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 140, HEIGHT / 400, 20, 20)];
    [self.backView addSubview:self.numberLabel];
    [_numberLabel release];
    self.numberLabel.layer.borderWidth = 1;
    self.numberLabel.layer.borderColor = [[UIColor redColor] CGColor];
    self.numberLabel.textAlignment = NSTextAlignmentCenter;
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 17, HEIGHT / 300, WIDTH - 20, 12)];
    [self.backView addSubview:self.titleLabel];
    [_titleLabel release];
    self.titleLabel.font = [UIFont systemFontOfSize:18.0];
    self.titleLabel.numberOfLines = 0;
    
    self.descLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 140, 13, WIDTH - 20, HEIGHT / 50)];
    [self.backView addSubview:self.descLabel];
    [_descLabel release];
    self.descLabel.font = [UIFont systemFontOfSize:14.0];
    self.descLabel.numberOfLines = 0;
    self.descLabel.textColor = [UIColor grayColor];
    
    self.picImageViewHead = [[UIImageView alloc] initWithFrame:CGRectMake(3, HEIGHT / 40, WIDTH - 6, HEIGHT / 7)];
    [self.backView addSubview:self.picImageViewHead];
    [_picImageViewHead release];
    
    //    self.picImageViewFoot = [[UIImageView alloc] init];
    //    [self.backView addSubview:self.picImageViewFoot];
    //    [_picImageViewFoot release];
    
    self.priceImageView = [[UIImageView alloc] init];
    [self.backView addSubview:self.priceImageView];
    [_priceImageView release];
    
    self.priceLabel = [[UILabel alloc] init];
    [self.backView addSubview:self.priceLabel];
    [_priceLabel release];
    
    self.commentLabel = [[UILabel alloc] init];
    [self.backView addSubview:self.commentLabel];
    [_commentLabel release];
    
    self.commentImageView = [[UIImageView alloc] init];
    [self.backView addSubview:self.commentImageView];
    [_commentImageView release];
    
    self.islikeLabel = [[UILabel alloc] init];
    [self.backView addSubview:self.islikeLabel];
    [_islikeLabel release];
    
    self.islikeImageView = [[UIImageView alloc] init];
    [self.backView addSubview:self.islikeImageView];
    [_islikeImageView release];
    
    self.buyButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.backView addSubview:self.buyButton];
    
    
}


@end
